package drugs

import (
	"Project/global"
)


type DrugsRecord struct {
	global.GVA_MODEL
	RecordID    int64  `json:"record_id"     gorm:"type:BIGINT; unique;NOT NULL;comment:记录唯一标识"`
	DrugsShopID int64  `json:"drugs_shop_id" gorm:"NOT NULL;index;comment:药店唯一标识"            binding:"required"`
	AreaID      int64  `json:"area_id"       gorm:"NOT NULL;index;comment:区县唯一标识"            binding:"required"`
	SaleName    string `json:"sale_name"     gorm:"NOT NULL; index;comment:销售人员姓名"           binding:"required"`
	Name        string `json:"user_name"     gorm:"type:VARCHAR(10); NOT NULL;comment:购药者"     binding:"required,lte=10"`
	Phone       string `json:"phone"         gorm:"type:CHAR(12);NOT NULL;comment:购药者电话"      binding:"required"`
	Card        string `json:"card"          gorm:"type:CHAR(19);NOT NULL;comment:购药者身份证"    binding:"required,numStr"`
	LivingArea  string `json:"living_area"   gorm:"type:varchar(10);NOT NULL;comment:购药者常住地（区县）"     binding:"required"`
	Address     string `json:"address"       gorm:"type:varchar(50);Not NULL;comment:购药者详细家庭地址"       binding:"required"`
	HighRisk    string `json:"high_risk"     gorm:"type:varchar(10);NOT NULL;comment:购药者是否高风险"        binding:"required"`
	ReasonUse   string `json:"reason_use"    gorm:"type:varchar(10);NOT NULL;comment:购药者购药用途"          binding:"required"`
}

func (DrugsRecord) TableName() string {
	return "drugs_record"
}
